package com.hctg.forced2sleep.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.actor.myandroidframework.adapter_viewpager.BaseFragmentPagerAdapter;
import com.hctg.forced2sleep.fragment.DiscoverFragment;
import com.hctg.forced2sleep.fragment.HomeFragment;
import com.hctg.forced2sleep.fragment.MineFragment;
import com.hctg.forced2sleep.fragment.StatisticFragment;

/**
 * description: 描述
 * company    :
 *
 * @author : ldf
 * date       : 2024/6/9 on 20
 * @version 1.0
 */
public class MainAdapter extends BaseFragmentPagerAdapter {

    public MainAdapter(FragmentManager fm/*, int size*/) {
        super(fm, 5);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
        case 0:
            return HomeFragment.newInstance();
        case 1:
        case 2:
            return DiscoverFragment.newInstance();
        case 3:
            return StatisticFragment.newInstance();
        default:
            return MineFragment.newInstance();
        }
    }
}
